//
//  GameCell.m
//  Dear
//
//  Created by 陈俊俊 on 15/7/19.
//  Copyright (c) 2015年 陈俊俊. All rights reserved.
//

#import "GameCell.h"
#import "UIImageView+WebCache.h"
@implementation GameCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setModel:(GameModel *)model
{
    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@?path=%@",ServerUrl,DearImage,model.pitcure]];
    [self.headImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"shoot1"]];
    self.titleLabel.text = model.name;
    self.contentLabel.numberOfLines = 0;
    self.contentLabel.text = model.content;
    self.sizeLabel.text = [NSString stringWithFormat:@"|%@",model.size_];
    self.downloadLabel.text = model.downAmount;
    
    CGFloat conH = 0;
    if (model.content.length > 0) {
        conH = [CJJHelper textHeightFromString:model.content width:ScreenSize.width - 30 fontSize:15];
    }
    self.contentH.constant = conH + 10;
    
    
    CGFloat sizeW = 0;
    if (model.downAmount.length > 0) {
        sizeW = [CJJHelper textWidthFromString:model.downAmount height:21 fontSize:14 ];
    }
    self.sizeW.constant = sizeW;
    [self layoutIfNeeded];
    
}
- (IBAction)downLoad:(id)sender {
}

@end
